Dynomotion

Group: DynoMotion Message: 2217 From: himykabibble Date: 11/13/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Tom,

Those will come in VERY handy! Thanks!

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@...> wrote:
>
>
>
>
> This test version allows some operations such as Halt, Execute, Zero X
> DRO, etc to be commanded from within a KFLOP User program. Typically
> this might be from an external pushbutton connected to a KFLOP input.
> There are some additional actions supported as well, see:
>
> Control KMotionCNC from KFLOP
> <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
>
> Also added is a means of specifying MCode Parameters for MCodes 100-119
> see:
>
> MCodes with Parameters
> <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
>
> This version also contains a fix for Mach3 probing in 6-axis.
> Unfortunately this involved shifting the Probe status variable from 56
> to 62 so existing probe C programs will require this modification. See
> the updated NotifyProbeMach3.c example where the status variable is now
> defined symbolically.
>
> A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> during a dwell is included.
>
> Any feedback appreciated.
>
>
>
> http://www.dynomotion.com/Software/KMotion428x.exe
> <http://www.dynomotion.com/Software/KMotion428x.exe>
>
> Thanks
>
> TK
>
Group: DynoMotion Message: 2219 From: albertplatek Date: 11/13/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Hi Tom,

Thank you for adding new functions!
I will test them soon.

Thanks again!

Best Regards
Albert P³atek

--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> Tom,
>
> Those will come in VERY handy! Thanks!
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@> wrote:
> >
> >
> >
> >
> > This test version allows some operations such as Halt, Execute, Zero X
> > DRO, etc to be commanded from within a KFLOP User program. Typically
> > this might be from an external pushbutton connected to a KFLOP input.
> > There are some additional actions supported as well, see:
> >
> > Control KMotionCNC from KFLOP
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> >
> > Also added is a means of specifying MCode Parameters for MCodes 100-119
> > see:
> >
> > MCodes with Parameters
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> >
> > This version also contains a fix for Mach3 probing in 6-axis.
> > Unfortunately this involved shifting the Probe status variable from 56
> > to 62 so existing probe C programs will require this modification. See
> > the updated NotifyProbeMach3.c example where the status variable is now
> > defined symbolically.
> >
> > A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> > during a dwell is included.
> >
> > Any feedback appreciated.
> >
> >
> >
> > http://www.dynomotion.com/Software/KMotion428x.exe
> > <http://www.dynomotion.com/Software/KMotion428x.exe>
> >
> > Thanks
> >
> > TK
> >
>
Group: DynoMotion Message: 2220 From: himykabibble Date: 11/13/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Tom,

The M-code argument passing works great. I'll try some of the new control functions tomorrow.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@...> wrote:
>
>
>
>
> This test version allows some operations such as Halt, Execute, Zero X
> DRO, etc to be commanded from within a KFLOP User program. Typically
> this might be from an external pushbutton connected to a KFLOP input.
> There are some additional actions supported as well, see:
>
> Control KMotionCNC from KFLOP
> <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
>
> Also added is a means of specifying MCode Parameters for MCodes 100-119
> see:
>
> MCodes with Parameters
> <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
>
> This version also contains a fix for Mach3 probing in 6-axis.
> Unfortunately this involved shifting the Probe status variable from 56
> to 62 so existing probe C programs will require this modification. See
> the updated NotifyProbeMach3.c example where the status variable is now
> defined symbolically.
>
> A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> during a dwell is included.
>
> Any feedback appreciated.
>
>
>
> http://www.dynomotion.com/Software/KMotion428x.exe
> <http://www.dynomotion.com/Software/KMotion428x.exe>
>
> Thanks
>
> TK
>
Group: DynoMotion Message: 2222 From: albertplatek Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Hi Tom,

When I want compile program with new function I get error:

tcc: undefined symbol 'DoPC'

#include "KMotionDef.h"
main()
{
DoPC(PC_COMM_HALT);
}

With other functions compiler aslo say it's undefined symbol.

Best Regards
Albert P³atek


--- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@...> wrote:
>
>
>
>
> This test version allows some operations such as Halt, Execute, Zero X
> DRO, etc to be commanded from within a KFLOP User program. Typically
> this might be from an external pushbutton connected to a KFLOP input.
> There are some additional actions supported as well, see:
>
> Control KMotionCNC from KFLOP
> <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
>
> Also added is a means of specifying MCode Parameters for MCodes 100-119
> see:
>
> MCodes with Parameters
> <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
>
> This version also contains a fix for Mach3 probing in 6-axis.
> Unfortunately this involved shifting the Probe status variable from 56
> to 62 so existing probe C programs will require this modification. See
> the updated NotifyProbeMach3.c example where the status variable is now
> defined symbolically.
>
> A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> during a dwell is included.
>
> Any feedback appreciated.
>
>
>
> http://www.dynomotion.com/Software/KMotion428x.exe
> <http://www.dynomotion.com/Software/KMotion428x.exe>
>
> Thanks
>
> TK
>
Group: DynoMotion Message: 2223 From: Tom Kerekes Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Hi Albert,
 
That function and other "helper" functions were included in the example.  You will need to add it into your file as well.
 
 
BTW if you need to debounce input switches there is a "helper" routine in the example Mach3_CL_PMDX.c called Debounce that may help you.  Often with push button switches it is necessary to debounce the switch and also detect when it is first pushed and do something only exactly once.  Writing loop to debounce one switch is easy but a single loop to debounce several (as well as to do other things in the same loop) can be more difficult.  The Debounce() routine can help with this.  It is written as a "state machine" such that it keeps track of what state it was in so it can exit and come back later and continue where it was in debouncing a signal.  It needs 3 unique variables to be declared for each signal so it can keep track of its state.  For example:
 
int flast=0,flastsolid=-1,fcount=0;
Then calling the routine will return a "1" or "0" one single time when it detects a change.   It returns -1 in all other cases.
 
  if (Debounce(ReadBit(FEEDHOLDBIT),&fcount,&flast,&flastsolid) == 0)
  {
      if (CS0_StoppingState == 0)
      {
          StopCoordinatedMotion();
          printf("Feed Hold on\n");
      }
  }
Regards
TK
 
 
 
 

Group: DynoMotion Message: 2224 From: Brad Murry Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL

Custom M-codes are going to open up some nice capabilities. 

 

Is there anything special or any gotchas for  porting  things over to .net?

 

-Brad Murry

 

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of TKSOFT
Sent: Sunday, November 13, 2011 10:44 PM
To: DynoMotion@yahoogroups.com
Subject: [DynoMotion] Experimental Version 4.28x allows control of KMotionCNC from KFLOP

 

 

This test version allows some operations such as Halt, Execute, Zero X DRO, etc to be commanded from within a KFLOP User program.  Typically this might be from an external pushbutton connected to a KFLOP input.  There are some additional actions supported as well, see:

Control KMotionCNC from KFLOP

Also added is a means of specifying MCode Parameters for MCodes 100-119 see:

MCodes with Parameters

This version also contains a fix for Mach3 probing in 6-axis.  Unfortunately this involved shifting the Probe status variable from 56 to 62 so existing probe C programs will require this modification.  See the updated NotifyProbeMach3.c example where the status variable is now defined symbolically.

A fix for an inappropriate Error MessageBox when KMotionCNC was halted during a dwell is included.

Any feedback appreciated.

http://www.dynomotion.com/Software/KMotion428x.exe

Thanks

TK

 

 

Group: DynoMotion Message: 2225 From: himykabibble Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
"A new example called KFLOPtoPCCmdExamples.c is included which demonstrates how to invoke these actions from a KFLOP User C Program." - I don't see that example in the C Program directory....

--- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@...> wrote:
>
>
>
>
> This test version allows some operations such as Halt, Execute, Zero X
> DRO, etc to be commanded from within a KFLOP User program. Typically
> this might be from an external pushbutton connected to a KFLOP input.
> There are some additional actions supported as well, see:
>
> Control KMotionCNC from KFLOP
> <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
>
> Also added is a means of specifying MCode Parameters for MCodes 100-119
> see:
>
> MCodes with Parameters
> <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
>
> This version also contains a fix for Mach3 probing in 6-axis.
> Unfortunately this involved shifting the Probe status variable from 56
> to 62 so existing probe C programs will require this modification. See
> the updated NotifyProbeMach3.c example where the status variable is now
> defined symbolically.
>
> A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> during a dwell is included.
>
> Any feedback appreciated.
>
>
>
> http://www.dynomotion.com/Software/KMotion428x.exe
> <http://www.dynomotion.com/Software/KMotion428x.exe>
>
> Thanks
>
> TK
>
Group: DynoMotion Message: 2226 From: Tom Kerekes Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Hi Brad,
 
Regarding the MCodes with parameters downloaded to KFLOP that is all handled in the lower C++ code so should be transparent to the higher level App.
 
Regarding commanding the KMotionCNC application you might consider adding something similar to your Machine Manager App.  Basically in your Timer loop that uploads status and updates your DROs and such put similar code as was added to KMotionCNC to detect a Command sent from KFLOP to do some "Action".  But you probably want to wait to see how well this works for Users of KMotionCNC.
 
Regards,
TK

Group: DynoMotion Message: 2227 From: Tom Kerekes Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Oops - no wonder Albert had trouble...
 
 
 
TK

Group: DynoMotion Message: 2228 From: albertplatek Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Hi Tom,
Problem solved, examples are here : http://www.dynomotion.com/Software/CPrograms/
And it works great!

Yes Debounce() routine will be very helpfull for input switches

Great job Tom and Thank You again !

Best Regards
Albert P³atek








--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Albert,
>  
> That function and other "helper" functions were included in the example.  You will need to add it into your file as well.
>  
>  
> BTW if you need to debounce input switches there is a "helper" routine in the example Mach3_CL_PMDX.c called Debounce that may help you.  Often with push button switches it is necessary to debounce the switch and also detect when it is first pushed and do something only exactly once.  Writing loop to debounce one switch is easy but a single loop to debounce several (as well as to do other things in the same loop) can be more difficult.  The Debounce() routine can help with this.  It is written as a "state machine" such that it keeps track of what state it was in so it can exit and come back later and continue where it was in debouncing a signal.  It needs 3 unique variables to be declared for each signal so it can keep track of its state.  For example:
>  
> int flast=0,flastsolid=-1,fcount=0;
>
> Then calling the routine will return a "1" or "0" one single time when it detects a change.   It returns -1 in all other cases.
>  
>   if (Debounce(ReadBit(FEEDHOLDBIT),&fcount,&flast,&flastsolid) == 0)
>   {
>       if (CS0_StoppingState == 0)
>       {
>           StopCoordinatedMotion();
>           printf("Feed Hold on\n");
>       }
>   }
>
> Regards
> TK
>  
>  
>  
>  
>
> From: albertplatek <albertplatek86@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, November 14, 2011 7:25 AM
> Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>
>
>  
> Hi Tom,
>
> When I want compile program with new function I get error:
>
> tcc: undefined symbol 'DoPC'
>
> #include "KMotionDef.h"
> main()
> {
> DoPC(PC_COMM_HALT);
> }
>
> With other functions compiler aslo say it's undefined symbol.
>
> Best Regards
> Albert P³atek
>
> --- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@> wrote:
> >
> >
> >
> >
> > This test version allows some operations such as Halt, Execute, Zero X
> > DRO, etc to be commanded from within a KFLOP User program. Typically
> > this might be from an external pushbutton connected to a KFLOP input.
> > There are some additional actions supported as well, see:
> >
> > Control KMotionCNC from KFLOP
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> >
> > Also added is a means of specifying MCode Parameters for MCodes 100-119
> > see:
> >
> > MCodes with Parameters
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> >
> > This version also contains a fix for Mach3 probing in 6-axis.
> > Unfortunately this involved shifting the Probe status variable from 56
> > to 62 so existing probe C programs will require this modification. See
> > the updated NotifyProbeMach3.c example where the status variable is now
> > defined symbolically.
> >
> > A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> > during a dwell is included.
> >
> > Any feedback appreciated.
> >
> >
> >
> > http://www.dynomotion.com/Software/KMotion428x.exe
> > <http://www.dynomotion.com/Software/KMotion428x.exe>
> >
> > Thanks
> >
> > TK
> >
>
Group: DynoMotion Message: 2231 From: Brad Murry Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL

Debounce() routines “close to the metal” sounds very nice.  Is that available as a script command?

 

-Brad

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of albertplatek
Sent: Monday, November 14, 2011 9:52 AM
To: DynoMotion@yahoogroups.com
Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP

 

 

Hi Tom,
Problem solved, examples are here : http://www.dynomotion.com/Software/CPrograms/
And it works great!

Yes Debounce() routine will be very helpfull for input switches

Great job Tom and Thank You again !

Best Regards
Albert P³atek

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Albert,
>  
> That function and other "helper" functions were included in the example.  You will need to add it into your file as well.
>  
>  
> BTW if you need to debounce input switches there is a "helper" routine in the example Mach3_CL_PMDX.c called Debounce that may help you.  Often with push button switches it is necessary to debounce the switch and also detect when it is first pushed and do something only exactly once.  Writing loop to debounce one switch is easy but a single loop to debounce several (as well as to do other things in the same loop) can be more difficult.  The Debounce() routine can help with this.  It is written as a "state machine" such that it keeps track of what state it was in so it can exit and come back later and continue where it was in debouncing a signal.  It needs 3 unique variables to be declared for each signal so it can keep track of its state.  For example:
>  
> int flast=0,flastsolid=-1,fcount=0;
>
> Then calling the routine will return a "1" or "0" one single time when it detects a change.   It returns -1 in all other cases.
>  
>   if (Debounce(ReadBit(FEEDHOLDBIT),&fcount,&flast,&flastsolid) == 0)
>   {
>       if (CS0_StoppingState == 0)
>       {
>           StopCoordinatedMotion();
>           printf("Feed Hold on\n");
>       }
>   }
>
> Regards
> TK
>  
>  
>  
>  
>
> From: albertplatek <albertplatek86@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, November 14, 2011 7:25 AM
> Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>
>
>  
> Hi Tom,
>
> When I want compile program with new function I get error:
>
> tcc: undefined symbol 'DoPC'
>
> #include "KMotionDef.h"
> main()
> {
> DoPC(PC_COMM_HALT);
> }
>
> With other functions compiler aslo say it's undefined symbol.
>
> Best Regards
> Albert P³atek
>
> --- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@> wrote:
> >
> >
> >
> >
> > This test version allows some operations such as Halt, Execute, Zero X
> > DRO, etc to be commanded from within a KFLOP User program. Typically
> > this might be from an external pushbutton connected to a KFLOP input.
> > There are some additional actions supported as well, see:
> >
> > Control KMotionCNC from KFLOP
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> >
> > Also added is a means of specifying MCode Parameters for MCodes 100-119
> > see:
> >
> > MCodes with Parameters
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> >
> > This version also contains a fix for Mach3 probing in 6-axis.
> > Unfortunately this involved shifting the Probe status variable from 56
> > to 62 so existing probe C programs will require this modification. See
> > the updated NotifyProbeMach3.c example where the status variable is now
> > defined symbolically.
> >
> > A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> > during a dwell is included.
> >
> > Any feedback appreciated.
> >
> >
> >
> > http://www.dynomotion.com/Software/KMotion428x.exe
> > <http://www.dynomotion.com/Software/KMotion428x.exe>
> >
> > Thanks
> >
> > TK
> >
>

Group: DynoMotion Message: 2232 From: Tom Kerekes Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Hi Brad,
 
No sorry, it requires to be called continuously as the debouncing is performed in software.
 
 Regards
TK

Group: DynoMotion Message: 2233 From: Brad Murry Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL

Dang….  Not so close to the metal then I suppose.  I always seem to be implementing debounce routines on the software level.  It sure would be nice to have that functionality(especially on devices < 24v), is that something you might add in the future?

 

-Brad

 

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
Sent: Monday, November 14, 2011 12:09 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP

 

 

Hi Brad,

 

No sorry, it requires to be called continuously as the debouncing is performed in software.

 

 Regards

TK

 

From: Brad Murry <bradodarb@...>
To: DynoMotion@yahoogroups.com
Sent: Monday, November 14, 2011 9:27 AM
Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP

 

Debounce() routines “close to the metal” sounds very nice.  Is that available as a script command?

 

-Brad

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of albertplatek
Sent: Monday, November 14, 2011 9:52 AM
To: DynoMotion@yahoogroups.com
Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP

 

 

Hi Tom,
Problem solved, examples are here : http://www.dynomotion.com/Software/CPrograms/
And it works great!

Yes Debounce() routine will be very helpfull for input switches

Great job Tom and Thank You again !

Best Regards
Albert P³atek

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Albert,
>  
> That function and other "helper" functions were included in the example.  You will need to add it into your file as well.
>  
>  
> BTW if you need to debounce input switches there is a "helper" routine in the example Mach3_CL_PMDX.c called Debounce that may help you.  Often with push button switches it is necessary to debounce the switch and also detect when it is first pushed and do something only exactly once.  Writing loop to debounce one switch is easy but a single loop to debounce several (as well as to do other things in the same loop) can be more difficult.  The Debounce() routine can help with this.  It is written as a "state machine" such that it keeps track of what state it was in so it can exit and come back later and continue where it was in debouncing a signal.  It needs 3 unique variables to be declared for each signal so it can keep track of its state.  For example:
>  
> int flast=0,flastsolid=-1,fcount=0;
>
> Then calling the routine will return a "1" or "0" one single time when it detects a change.   It returns -1 in all other cases.
>  
>   if (Debounce(ReadBit(FEEDHOLDBIT),&fcount,&flast,&flastsolid) == 0)
>   {
>       if (CS0_StoppingState == 0)
>       {
>           StopCoordinatedMotion();
>           printf("Feed Hold on\n");
>       }
>   }
>
> Regards
> TK
>  
>  
>  
>  
>
> From: albertplatek <albertplatek86@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, November 14, 2011 7:25 AM
> Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>
>
>  
> Hi Tom,
>
> When I want compile program with new function I get error:
>
> tcc: undefined symbol 'DoPC'
>
> #include "KMotionDef.h"
> main()
> {
> DoPC(PC_COMM_HALT);
> }
>
> With other functions compiler aslo say it's undefined symbol.
>
> Best Regards
> Albert P³atek
>
> --- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@> wrote:
> >
> >
> >
> >
> > This test version allows some operations such as Halt, Execute, Zero X
> > DRO, etc to be commanded from within a KFLOP User program. Typically
> > this might be from an external pushbutton connected to a KFLOP input.
> > There are some additional actions supported as well, see:
> >
> > Control KMotionCNC from KFLOP
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> >
> > Also added is a means of specifying MCode Parameters for MCodes 100-119
> > see:
> >
> > MCodes with Parameters
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> >
> > This version also contains a fix for Mach3 probing in 6-axis.
> > Unfortunately this involved shifting the Probe status variable from 56
> > to 62 so existing probe C programs will require this modification. See
> > the updated NotifyProbeMach3.c example where the status variable is now
> > defined symbolically.
> >
> > A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> > during a dwell is included.
> >
> > Any feedback appreciated.
> >
> >
> >
> > http://www.dynomotion.com/Software/KMotion428x.exe
> > <http://www.dynomotion.com/Software/KMotion428x.exe>
> >
> > Thanks
> >
> > TK
> >
>

 

Group: DynoMotion Message: 2234 From: Tom Kerekes Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Hi Brad,
 
Well I'm not sure I entirely understand the issue, and doing it under Windows would be ugly.  In pure hardware (the FPGA) is also messy as it would require a bunch of configuration registers, counters, and so forth for each bit.  It seems like the DSP is a good place for it.  You could just have a service routine running in KFLOP to de-bounce a bunch of hardware Inputs and map them to equivalent virtual inputs.  Or to take it a step further it could detect a change (edge) and send it as an "action" event to your application.
 
Regards
TK

Group: DynoMotion Message: 2235 From: himykabibble Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Tom,

Is it possible you broke the Mach3 plugin? I'm still struggling to get this working right on the machine, and things that worked with 426 don't work with 427:

1) I'm using a modified Mach3SpindlePWM.c for spindle control. Yesterday, it was working fine with 426. Today, with 428, it will turn the spindle on, but not off - it appears the C program is never getting the spindle off messages. If I configure the relay outputs to be directly controlled by Mach3, it works properly.

2) Probing is still not working right. Works correctly sometimes, but at other times it seems to simply not see the probe input changing, even though it is ALWAYS properly reflected by an on-screen LED in Mach3. So, again, seems to be communications problems between Mach3 and the C program. Also, once a G31 on the A axis fails, it does a jog on the X axis!

3) Can't get Mach3 to recognize my Z axis home/limits at all. The state changes DO show up in the digital I/O dialog in KMotion. I KNOW the hardware works properly (been in use for years). But, even if I change the active low state in Ports & Pins configuration, I cannot trigger a limit fault. Are they just ignored, and required to be done in the KFlop?

4) E-Stop seems to trigger some weird things. I have a DRO that displays the current continuous jog speed. Toggling E-Stop resets the DRO!

Otherwise, in Mach3, all axes seem to move OK, coolant controls work, spindle works (with above exception).

I un-installed v426, wiped every trace of it off the machine, installed v428x, copied in my C programs, and KMotionCNC STILL starts jogging all axes as soon as Init is run. I have no clue where to even begin to look for this one. X and A jog -, while Y and Z jog +, and they all just keep running forever. And they all run at the exact same speed, with the DROs counting in perfect unison.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Brad,
>  
> Well I'm not sure I entirely understand the issue, and doing it under Windows would be ugly.  In pure hardware (the FPGA) is also messy as it would require a bunch of configuration registers, counters, and so forth for each bit.  It seems like the DSP is a good place for it.  You could just have a service routine running in KFLOP to de-bounce a bunch of hardware Inputs and map them to equivalent virtual inputs.  Or to take it a step further it could detect a change (edge) and send it as an "action" event to your application.
>  
> Regards
> TK
>
> From: Brad Murry <bradodarb@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, November 14, 2011 11:14 AM
> Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>
>
>  
> Dang….  Not so close to the metal then I suppose.  I always seem to be implementing debounce routines on the software level.  It sure would be nice to have that functionality(especially on devices < 24v), is that something you might add in the future?
>  
> -Brad
>  
> From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> Sent: Monday, November 14, 2011 12:09 PM
> To: DynoMotion@yahoogroups.com
> Subject: Re: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>  
>  
> Hi Brad,
>  
> No sorry, it requires to be called continuously as the debouncing is performed in software.
>  
>  Regards
> TK
>  
> From:Brad Murry <bradodarb@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, November 14, 2011 9:27 AM
> Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>  
> Debounce() routines “close to the metal” sounds very nice.  Is that available as a script command?
>  
> -Brad
> From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of albertplatek
> Sent: Monday, November 14, 2011 9:52 AM
> To: DynoMotion@yahoogroups.com
> Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>  
>  
> Hi Tom,
> Problem solved, examples are here : http://www.dynomotion.com/Software/CPrograms/
> And it works great!
>
> Yes Debounce() routine will be very helpfull for input switches
>
> Great job Tom and Thank You again !
>
> Best Regards
> Albert P³atek
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Albert,
> >  
> > That function and other "helper" functions were included in the example.  You will need to add it into your file as well.
> >  
> >  
> > BTW if you need to debounce input switches there is a "helper" routine in the example Mach3_CL_PMDX.c called Debounce that may help you.  Often with push button switches it is necessary to debounce the switch and also detect when it is first pushed and do something only exactly once.  Writing loop to debounce one switch is easy but a single loop to debounce several (as well as to do other things in the same loop) can be more difficult.  The Debounce() routine can help with this.  It is written as a "state machine" such that it keeps track of what state it was in so it can exit and come back later and continue where it was in debouncing a signal.  It needs 3 unique variables to be declared for each signal so it can keep track of its state.  For example:
> >  
> > int flast=0,flastsolid=-1,fcount=0;
> >
> > Then calling the routine will return a "1" or "0" one single time when it detects a change.   It returns -1 in all other cases.
> >  
> >   if (Debounce(ReadBit(FEEDHOLDBIT),&fcount,&flast,&flastsolid) == 0)
> >   {
> >       if (CS0_StoppingState == 0)
> >       {
> >           StopCoordinatedMotion();
> >           printf("Feed Hold on\n");
> >       }
> >   }
> >
> > Regards
> > TK
> >  
> >  
> >  
> >  
> >
> > From: albertplatek <albertplatek86@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Monday, November 14, 2011 7:25 AM
> > Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> >
> >
> >  
> > Hi Tom,
> >
> > When I want compile program with new function I get error:
> >
> > tcc: undefined symbol 'DoPC'
> >
> > #include "KMotionDef.h"
> > main()
> > {
> > DoPC(PC_COMM_HALT);
> > }
> >
> > With other functions compiler aslo say it's undefined symbol.
> >
> > Best Regards
> > Albert P³atek
> >
> > --- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@> wrote:
> > >
> > >
> > >
> > >
> > > This test version allows some operations such as Halt, Execute, Zero X
> > > DRO, etc to be commanded from within a KFLOP User program. Typically
> > > this might be from an external pushbutton connected to a KFLOP input.
> > > There are some additional actions supported as well, see:
> > >
> > > Control KMotionCNC from KFLOP
> > > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > >
> > > Also added is a means of specifying MCode Parameters for MCodes 100-119
> > > see:
> > >
> > > MCodes with Parameters
> > > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > >
> > > This version also contains a fix for Mach3 probing in 6-axis.
> > > Unfortunately this involved shifting the Probe status variable from 56
> > > to 62 so existing probe C programs will require this modification. See
> > > the updated NotifyProbeMach3.c example where the status variable is now
> > > defined symbolically.
> > >
> > > A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> > > during a dwell is included.
> > >
> > > Any feedback appreciated.
> > >
> > >
> > >
> > > http://www.dynomotion.com/Software/KMotion428x.exe
> > > <http://www.dynomotion.com/Software/KMotion428x.exe>
> > >
> > > Thanks
> > >
> > > TK
> > >
> >
>  
>
Group: DynoMotion Message: 2236 From: himykabibble Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Sorry, that second sentence should have read: "...and things that worked with 426 don't work with 428x"

--- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@...> wrote:
>
> Tom,
>
> Is it possible you broke the Mach3 plugin? I'm still struggling to get this working right on the machine, and things that worked with 426 don't work with 427:
>
> 1) I'm using a modified Mach3SpindlePWM.c for spindle control. Yesterday, it was working fine with 426. Today, with 428, it will turn the spindle on, but not off - it appears the C program is never getting the spindle off messages. If I configure the relay outputs to be directly controlled by Mach3, it works properly.
>
> 2) Probing is still not working right. Works correctly sometimes, but at other times it seems to simply not see the probe input changing, even though it is ALWAYS properly reflected by an on-screen LED in Mach3. So, again, seems to be communications problems between Mach3 and the C program. Also, once a G31 on the A axis fails, it does a jog on the X axis!
>
> 3) Can't get Mach3 to recognize my Z axis home/limits at all. The state changes DO show up in the digital I/O dialog in KMotion. I KNOW the hardware works properly (been in use for years). But, even if I change the active low state in Ports & Pins configuration, I cannot trigger a limit fault. Are they just ignored, and required to be done in the KFlop?
>
> 4) E-Stop seems to trigger some weird things. I have a DRO that displays the current continuous jog speed. Toggling E-Stop resets the DRO!
>
> Otherwise, in Mach3, all axes seem to move OK, coolant controls work, spindle works (with above exception).
>
> I un-installed v426, wiped every trace of it off the machine, installed v428x, copied in my C programs, and KMotionCNC STILL starts jogging all axes as soon as Init is run. I have no clue where to even begin to look for this one. X and A jog -, while Y and Z jog +, and they all just keep running forever. And they all run at the exact same speed, with the DROs counting in perfect unison.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Brad,
> >  
> > Well I'm not sure I entirely understand the issue, and doing it under Windows would be ugly.  In pure hardware (the FPGA) is also messy as it would require a bunch of configuration registers, counters, and so forth for each bit.  It seems like the DSP is a good place for it.  You could just have a service routine running in KFLOP to de-bounce a bunch of hardware Inputs and map them to equivalent virtual inputs.  Or to take it a step further it could detect a change (edge) and send it as an "action" event to your application.
> >  
> > Regards
> > TK
> >
> > From: Brad Murry <bradodarb@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Monday, November 14, 2011 11:14 AM
> > Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> >
> >
> >  
> > Dang….  Not so close to the metal then I suppose.  I always seem to be implementing debounce routines on the software level.  It sure would be nice to have that functionality(especially on devices < 24v), is that something you might add in the future?
> >  
> > -Brad
> >  
> > From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> > Sent: Monday, November 14, 2011 12:09 PM
> > To: DynoMotion@yahoogroups.com
> > Subject: Re: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> >  
> >  
> > Hi Brad,
> >  
> > No sorry, it requires to be called continuously as the debouncing is performed in software.
> >  
> >  Regards
> > TK
> >  
> > From:Brad Murry <bradodarb@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Monday, November 14, 2011 9:27 AM
> > Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> >  
> > Debounce() routines “close to the metal” sounds very nice.  Is that available as a script command?
> >  
> > -Brad
> > From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of albertplatek
> > Sent: Monday, November 14, 2011 9:52 AM
> > To: DynoMotion@yahoogroups.com
> > Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> >  
> >  
> > Hi Tom,
> > Problem solved, examples are here : http://www.dynomotion.com/Software/CPrograms/
> > And it works great!
> >
> > Yes Debounce() routine will be very helpfull for input switches
> >
> > Great job Tom and Thank You again !
> >
> > Best Regards
> > Albert P³atek
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Albert,
> > >  
> > > That function and other "helper" functions were included in the example.  You will need to add it into your file as well.
> > >  
> > >  
> > > BTW if you need to debounce input switches there is a "helper" routine in the example Mach3_CL_PMDX.c called Debounce that may help you.  Often with push button switches it is necessary to debounce the switch and also detect when it is first pushed and do something only exactly once.  Writing loop to debounce one switch is easy but a single loop to debounce several (as well as to do other things in the same loop) can be more difficult.  The Debounce() routine can help with this.  It is written as a "state machine" such that it keeps track of what state it was in so it can exit and come back later and continue where it was in debouncing a signal.  It needs 3 unique variables to be declared for each signal so it can keep track of its state.  For example:
> > >  
> > > int flast=0,flastsolid=-1,fcount=0;
> > >
> > > Then calling the routine will return a "1" or "0" one single time when it detects a change.   It returns -1 in all other cases.
> > >  
> > >   if (Debounce(ReadBit(FEEDHOLDBIT),&fcount,&flast,&flastsolid) == 0)
> > >   {
> > >       if (CS0_StoppingState == 0)
> > >       {
> > >           StopCoordinatedMotion();
> > >           printf("Feed Hold on\n");
> > >       }
> > >   }
> > >
> > > Regards
> > > TK
> > >  
> > >  
> > >  
> > >  
> > >
> > > From: albertplatek <albertplatek86@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Monday, November 14, 2011 7:25 AM
> > > Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> > >
> > >
> > >  
> > > Hi Tom,
> > >
> > > When I want compile program with new function I get error:
> > >
> > > tcc: undefined symbol 'DoPC'
> > >
> > > #include "KMotionDef.h"
> > > main()
> > > {
> > > DoPC(PC_COMM_HALT);
> > > }
> > >
> > > With other functions compiler aslo say it's undefined symbol.
> > >
> > > Best Regards
> > > Albert P³atek
> > >
> > > --- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@> wrote:
> > > >
> > > >
> > > >
> > > >
> > > > This test version allows some operations such as Halt, Execute, Zero X
> > > > DRO, etc to be commanded from within a KFLOP User program. Typically
> > > > this might be from an external pushbutton connected to a KFLOP input.
> > > > There are some additional actions supported as well, see:
> > > >
> > > > Control KMotionCNC from KFLOP
> > > > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > > > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > > >
> > > > Also added is a means of specifying MCode Parameters for MCodes 100-119
> > > > see:
> > > >
> > > > MCodes with Parameters
> > > > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > > > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > > >
> > > > This version also contains a fix for Mach3 probing in 6-axis.
> > > > Unfortunately this involved shifting the Probe status variable from 56
> > > > to 62 so existing probe C programs will require this modification. See
> > > > the updated NotifyProbeMach3.c example where the status variable is now
> > > > defined symbolically.
> > > >
> > > > A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> > > > during a dwell is included.
> > > >
> > > > Any feedback appreciated.
> > > >
> > > >
> > > >
> > > > http://www.dynomotion.com/Software/KMotion428x.exe
> > > > <http://www.dynomotion.com/Software/KMotion428x.exe>
> > > >
> > > > Thanks
> > > >
> > > > TK
> > > >
> > >
> >  
> >
>
Group: DynoMotion Message: 2237 From: Tom Kerekes Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Hi Ray,
 
Regarding:
 
#1 - don't know.  It is possible.  Could you could go back to 4.26 and see?
 
#2 - don't know what is going on here either.  You would need to supply all the details.  Probing in the A axis was not functional in the Versions prior to V4.28x but should not have made the X axis move.  The installation of KMotion does 2 things regarding Mach3.  It copy that version of Plugin to the Mach3 directory you specify and it also make a Registry enty "APP PATHS" that allow the plugin to find the KMotion DLLs.  If you are mixing versions of Mach3, the Plugin, and the KMotion Version I suppose weird things could happen.
 
#3 - All homing and limits now need to be handled by KFLOP.  I thought we went through this before when we un-configured all those in Mach3.  With KFLOP there is no parallel port Windows Kernel driver and so there is no real-time capability to watch limit switches, jog, do homing, etc...
 
#4 - Seems like Estop should disable the axis and make the speed zero so not sure what you mean.
 
Regards
TK
 

Group: DynoMotion Message: 2238 From: himykabibble Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Tom,

See below....

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>  
> Regarding:
>  
> #1 - don't know.  It is possible.  Could you could go back to 4.26 and see?

Yes, I'll revert and check again. But it was working fine yesterday.

>
> #2 - don't know what is going on here either.  You would need to supply all the details.  Probing in the A axis was not functional in the Versions prior to V4.28x but should not have made the X axis move.  The installation of KMotion does 2 things regarding Mach3.  It copy that version of Plugin to the Mach3 directory you specify and it also make a Registry enty "APP PATHS" that allow the plugin to find the KMotion DLLs.  If you are mixing versions of Mach3, the Plugin, and the KMotion Version I suppose weird things could happen.

Not mixing versions. I completely un-installed 426, and deleted the directory, then installed 428x, and copied the Data directory over from my laptop. I'm working in a dedicated Mach3 directory, which started as a copy of my working SmoothStepper Mach3 directory. It is re-named to "Mach3", so no chance it's pulling files from the wrong place.

>
> #3 - All homing and limits now need to be handled by KFLOP.  I thought we went through this before when we un-configured all those in Mach3.  With KFLOP there is no parallel port Windows Kernel driver and so there is no real-time capability to watch limit switches, jog, do homing, etc...

OK, I was not clear that home/limits HAD to be that way - just thought it was better that way. I can fix that easily enough. But, probing IS being handled by KFlop, and it's also very unreliable. Do you find it's normally necessary to de-bounce those inputs? I have no de-bounce, and it all works perfectly when I run on my laptop with a switch for the probe input. I have a ~2K pullup on the input, and the switch pulls to ground.
 
> #4 - Seems like Estop should disable the axis and make the speed zero so not sure what you mean.

Stop and disable the axis, sure. But a completely un-related DRO (Mach3 OEM DRO 3 - Slow Jog %) is getting re-written, which makes no sense.

>
> Regards
> TK
>  
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, November 14, 2011 12:11 PM
> Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>
>
>  
> Sorry, that second sentence should have read: "...and things that worked with 426 don't work with 428x"
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> >
> > Tom,
> >
> > Is it possible you broke the Mach3 plugin? I'm still struggling to get this working right on the machine, and things that worked with 426 don't work with 427:
> >
> > 1) I'm using a modified Mach3SpindlePWM.c for spindle control. Yesterday, it was working fine with 426. Today, with 428, it will turn the spindle on, but not off - it appears the C program is never getting the spindle off messages. If I configure the relay outputs to be directly controlled by Mach3, it works properly.
> >
> > 2) Probing is still not working right. Works correctly sometimes, but at other times it seems to simply not see the probe input changing, even though it is ALWAYS properly reflected by an on-screen LED in Mach3. So, again, seems to be communications problems between Mach3 and the C program. Also, once a G31 on the A axis fails, it does a jog on the X axis!
> >
> > 3) Can't get Mach3 to recognize my Z axis home/limits at all. The state changes DO show up in the digital I/O dialog in KMotion. I KNOW the hardware works properly (been in use for years). But, even if I change the active low state in Ports & Pins configuration, I cannot trigger a limit fault. Are they just ignored, and required to be done in the KFlop?
> >
> > 4) E-Stop seems to trigger some weird things. I have a DRO that displays the current continuous jog speed. Toggling E-Stop resets the DRO!
> >
> > Otherwise, in Mach3, all axes seem to move OK, coolant controls work, spindle works (with above exception).
> >
> > I un-installed v426, wiped every trace of it off the machine, installed v428x, copied in my C programs, and KMotionCNC STILL starts jogging all axes as soon as Init is run. I have no clue where to even begin to look for this one. X and A jog -, while Y and Z jog +, and they all just keep running forever. And they all run at the exact same speed, with the DROs counting in perfect unison.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Brad,
> > >  
> > > Well I'm not sure I entirely understand the issue, and doing it under Windows would be ugly.  In pure hardware (the FPGA) is also messy as it would require a bunch of configuration registers, counters, and so forth for each bit.  It seems like the DSP is a good place for it.  You could just have a service routine running in KFLOP to de-bounce a bunch of hardware Inputs and map them to equivalent virtual inputs.  Or to take it a step further it could detect a change (edge) and send it as an "action" event to your application.
> > >  
> > > Regards
> > > TK
> > >
> > > From: Brad Murry <bradodarb@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Monday, November 14, 2011 11:14 AM
> > > Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> > >
> > >
> > >  
> > > Dang….  Not so close to the metal then I suppose.  I always seem to be implementing debounce routines on the software level.  It sure would be nice to have that functionality(especially on devices < 24v), is that something you might add in the future?
> > >  
> > > -Brad
> > >  
> > > From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> > > Sent: Monday, November 14, 2011 12:09 PM
> > > To: DynoMotion@yahoogroups.com
> > > Subject: Re: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> > >  
> > >  
> > > Hi Brad,
> > >  
> > > No sorry, it requires to be called continuously as the debouncing is performed in software.
> > >  
> > >  Regards
> > > TK
> > >  
> > > From:Brad Murry <bradodarb@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Monday, November 14, 2011 9:27 AM
> > > Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> > >  
> > > Debounce() routines “close to the metal” sounds very nice.  Is that available as a script command?
> > >  
> > > -Brad
> > > From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of albertplatek
> > > Sent: Monday, November 14, 2011 9:52 AM
> > > To: DynoMotion@yahoogroups.com
> > > Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> > >  
> > >  
> > > Hi Tom,
> > > Problem solved, examples are here : http://www.dynomotion.com/Software/CPrograms/
> > > And it works great!
> > >
> > > Yes Debounce() routine will be very helpfull for input switches
> > >
> > > Great job Tom and Thank You again !
> > >
> > > Best Regards
> > > Albert P³atek
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Albert,
> > > >  
> > > > That function and other "helper" functions were included in the example.  You will need to add it into your file as well.
> > > >  
> > > >  
> > > > BTW if you need to debounce input switches there is a "helper" routine in the example Mach3_CL_PMDX.c called Debounce that may help you.  Often with push button switches it is necessary to debounce the switch and also detect when it is first pushed and do something only exactly once.  Writing loop to debounce one switch is easy but a single loop to debounce several (as well as to do other things in the same loop) can be more difficult.  The Debounce() routine can help with this.  It is written as a "state machine" such that it keeps track of what state it was in so it can exit and come back later and continue where it was in debouncing a signal.  It needs 3 unique variables to be declared for each signal so it can keep track of its state.  For example:
> > > >  
> > > > int flast=0,flastsolid=-1,fcount=0;
> > > >
> > > > Then calling the routine will return a "1" or "0" one single time when it detects a change.   It returns -1 in all other cases.
> > > >  
> > > >   if (Debounce(ReadBit(FEEDHOLDBIT),&fcount,&flast,&flastsolid) == 0)
> > > >   {
> > > >       if (CS0_StoppingState == 0)
> > > >       {
> > > >           StopCoordinatedMotion();
> > > >           printf("Feed Hold on\n");
> > > >       }
> > > >   }
> > > >
> > > > Regards
> > > > TK
> > > >  
> > > >  
> > > >  
> > > >  
> > > >
> > > > From: albertplatek <albertplatek86@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Monday, November 14, 2011 7:25 AM
> > > > Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> > > >
> > > >
> > > >  
> > > > Hi Tom,
> > > >
> > > > When I want compile program with new function I get error:
> > > >
> > > > tcc: undefined symbol 'DoPC'
> > > >
> > > > #include "KMotionDef.h"
> > > > main()
> > > > {
> > > > DoPC(PC_COMM_HALT);
> > > > }
> > > >
> > > > With other functions compiler aslo say it's undefined symbol.
> > > >
> > > > Best Regards
> > > > Albert P³atek
> > > >
> > > > --- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@> wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > This test version allows some operations such as Halt, Execute, Zero X
> > > > > DRO, etc to be commanded from within a KFLOP User program. Typically
> > > > > this might be from an external pushbutton connected to a KFLOP input.
> > > > > There are some additional actions supported as well, see:
> > > > >
> > > > > Control KMotionCNC from KFLOP
> > > > > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > > > > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > > > >
> > > > > Also added is a means of specifying MCode Parameters for MCodes 100-119
> > > > > see:
> > > > >
> > > > > MCodes with Parameters
> > > > > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > > > > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > > > >
> > > > > This version also contains a fix for Mach3 probing in 6-axis.
> > > > > Unfortunately this involved shifting the Probe status variable from 56
> > > > > to 62 so existing probe C programs will require this modification. See
> > > > > the updated NotifyProbeMach3.c example where the status variable is now
> > > > > defined symbolically.
> > > > >
> > > > > A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> > > > > during a dwell is included.
> > > > >
> > > > > Any feedback appreciated.
> > > > >
> > > > >
> > > > >
> > > > > http://www.dynomotion.com/Software/KMotion428x.exe
> > > > > <http://www.dynomotion.com/Software/KMotion428x.exe>
> > > > >
> > > > > Thanks
> > > > >
> > > > > TK
> > > > >
> > > >
> > >  
> > >
> >
>
Group: DynoMotion Message: 2240 From: brad murry Date: 11/14/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Dsp sounds like the way for sure.  Right now the most reliable method I use when constrained to windows code(.net or c++) is to loop for a fixed amount of cycles, adding or subtracting from a baseline int.  In a perfect noiseless environment, I would start at zero and if my debounce cycle routine had ten cycles a positive result (true) would be ten and a  a false would return negative ten.  In the real world I use a threshold to determine if it was a good result and vary the tolerance of the threshold depending on how critical the function of whatever I am controlling is(usually >50% is good).  I implement this int the hardware's supported language when possible and i think this could be achieved in a c program directly on the kflop.  But it would be huge in terms if accuracy and convenience if there were a native script command or something to read values like IsSolidOn(int cycles, int threshold)... Or something to that effect.


New features look great btw, look forward to taking advantage of them.

-Brad Murry

From: Tom Kerekes
Sent: 11/14/2011 12:43 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP

 

Hi Brad,
 
Well I'm not sure I entirely understand the issue, and doing it under Windows would be ugly.  In pure hardware (the FPGA) is also messy as it would require a bunch of configuration registers, counters, and so forth for each bit.  It seems like the DSP is a good place for it.  You could just have a service routine running in KFLOP to de-bounce a bunch of hardware Inputs and map them to equivalent virtual inputs.  Or to take it a step further it could detect a change (edge) and send it as an "action" event to your application.
 
Regards
TK

From: Brad Murry <bradodarb@...>
To: DynoMotion@yahoogroups.com
Sent: Monday, November 14, 2011 11:14 AM
Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP

 
Dang….  Not so close to the metal then I suppose.  I always seem to be implementing debounce routines on the software level.  It sure would be nice to have that functionality(especially on devices < 24v), is that something you might add in the future?
 
-Brad
 
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
Sent: Monday, November 14, 2011 12:09 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
 
 
Hi Brad,
 
No sorry, it requires to be called continuously as the debouncing is performed in software.
 
 Regards
TK
 
From: Brad Murry <bradodarb@...>
To: DynoMotion@yahoogroups.com
Sent: Monday, November 14, 2011 9:27 AM
Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
 
Debounce() routines “close to the metal” sounds very nice.  Is that available as a script command?
 
-Brad
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of albertplatek
Sent: Monday, November 14, 2011 9:52 AM
To: DynoMotion@yahoogroups.com
Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
 
 
Hi Tom,
Problem solved, examples are here : http://www.dynomotion.com/Software/CPrograms/
And it works great!

Yes Debounce() routine will be very helpfull for input switches

Great job Tom and Thank You again !

Best Regards
Albert P³atek

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Albert,
>  
> That function and other "helper" functions were included in the example.  You will need to add it into
your file as well.
>  
>  
> BTW if you need to debounce input switches there is a "helper" routine in the example Mach3_CL_PMDX.c called
Debounce that may help you.  Often with push button switches it is necessary to debounce the switch and also detect when it is first pushed and do something only exactly once.  Writing loop to debounce one switch is easy but a single loop to debounce several (as well as to do other things in the same loop) can be more difficult.  The Debounce() routine can help with this.  It is written as a "state machine" such that it keeps track of what state it was in so it can exit and come back later and continue where it was in debouncing a signal.  It needs 3 unique variables to be declared for each signal so it can keep track of its state.  For example:
>  
> int flast=0,flastsolid=-1,fcount=0;
>
> Then calling the routine will return a "1" or "0" one single time when it detects a change.   It returns -1 in all other cases.
>  
>   if (Debounce(ReadBit(FEEDHOLDBIT),&fcount,&flast,&flastsolid)
== 0)
>   {
>       if (CS0_StoppingState == 0)
>       {
>           StopCoordinatedMotion();
>           printf("Feed Hold on\n");
>       }
>   }
>
> Regards
> TK
>  
>  
>  
>  
>
> From: albertplatek <albertplatek86@...>
> To:
DynoMotion@yahoogroups.com
> Sent: Monday, November 14, 2011 7:25 AM
> Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of
KMotionCNC
from KFLOP
>
>
>  
> Hi Tom,
>
> When I want compile program with new function I get error:
>
> tcc: undefined symbol 'DoPC'
>
> #include "KMotionDef.h"
> main()
> {
> DoPC(PC_COMM_HALT);
> }
>
> With other functions compiler aslo say it's undefined symbol.
>
> Best Regards
> Albert ³atek
>
> --- In
DynoMotion@yahoogroups.com, "TKSOFT" <tk@> wrote:
> >
> >
> >
> >
> > This test version allows some operations such as Halt, Execute, Zero X
> > DRO, etc to be commanded from within a
KFLOP User program. Typically
> > this might be from an external pushbutton connected to a
KFLOP input.
> > There are some additional actions supported as well, see:
> >
> > Control KMotionCNC from
KFLOP
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> >
> > Also added is a means of specifying MCode Parameters for
MCodes 100-119
> > see:
> >
> > MCodes with Parameters
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> >
> > This version also contains a fix for Mach3 probing in 6-axis.
> > Unfortunately this involved shifting the Probe status variable from 56
> > to 62 so existing probe C programs will require this modification. See
> > the updated NotifyProbeMach3.c example where the status variable is now
> > defined symbolically.
> >
> > A fix for an inappropriate Error MessageBox when
KMotionCNC was halted
> > during a dwell is included.
> >
> > Any feedback appreciated.
> >
> >
> >
> > http://www.dynomotion.com/Software/KMotion428x.exe
> > <http://www.dynomotion.com/Software/KMotion428x.exe>
> >
> > Thanks
> >
> > TK
> >
>
 


Group: DynoMotion Message: 2300 From: bradodarb Date: 11/18/2011
Subject: Re: Experimental Version 4.28x allows control of KMotionCNC from KFL
Hey Tom,

Not really an issue, just a misunderstanding of a new feature that sorta turned into a feature request....

-Brad Murry

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Brad,
>  
> Well I'm not sure I entirely understand the issue, and doing it under Windows would be ugly.  In pure hardware (the FPGA) is also messy as it would require a bunch of configuration registers, counters, and so forth for each bit.  It seems like the DSP is a good place for it.  You could just have a service routine running in KFLOP to de-bounce a bunch of hardware Inputs and map them to equivalent virtual inputs.  Or to take it a step further it could detect a change (edge) and send it as an "action" event to your application.
>  
> Regards
> TK
>
> From: Brad Murry <bradodarb@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, November 14, 2011 11:14 AM
> Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>
>
>  
> Dang….  Not so close to the metal then I suppose.  I always seem to be implementing debounce routines on the software level.  It sure would be nice to have that functionality(especially on devices < 24v), is that something you might add in the future?
>  
> -Brad
>  
> From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes
> Sent: Monday, November 14, 2011 12:09 PM
> To: DynoMotion@yahoogroups.com
> Subject: Re: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>  
>  
> Hi Brad,
>  
> No sorry, it requires to be called continuously as the debouncing is performed in software.
>  
>  Regards
> TK
>  
> From:Brad Murry <bradodarb@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, November 14, 2011 9:27 AM
> Subject: RE: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>  
> Debounce() routines “close to the metal” sounds very nice.  Is that available as a script command?
>  
> -Brad
> From:DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of albertplatek
> Sent: Monday, November 14, 2011 9:52 AM
> To: DynoMotion@yahoogroups.com
> Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
>  
>  
> Hi Tom,
> Problem solved, examples are here : http://www.dynomotion.com/Software/CPrograms/
> And it works great!
>
> Yes Debounce() routine will be very helpfull for input switches
>
> Great job Tom and Thank You again !
>
> Best Regards
> Albert P³atek
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Albert,
> >  
> > That function and other "helper" functions were included in the example.  You will need to add it into your file as well.
> >  
> >  
> > BTW if you need to debounce input switches there is a "helper" routine in the example Mach3_CL_PMDX.c called Debounce that may help you.  Often with push button switches it is necessary to debounce the switch and also detect when it is first pushed and do something only exactly once.  Writing loop to debounce one switch is easy but a single loop to debounce several (as well as to do other things in the same loop) can be more difficult.  The Debounce() routine can help with this.  It is written as a "state machine" such that it keeps track of what state it was in so it can exit and come back later and continue where it was in debouncing a signal.  It needs 3 unique variables to be declared for each signal so it can keep track of its state.  For example:
> >  
> > int flast=0,flastsolid=-1,fcount=0;
> >
> > Then calling the routine will return a "1" or "0" one single time when it detects a change.   It returns -1 in all other cases.
> >  
> >   if (Debounce(ReadBit(FEEDHOLDBIT),&fcount,&flast,&flastsolid) == 0)
> >   {
> >       if (CS0_StoppingState == 0)
> >       {
> >           StopCoordinatedMotion();
> >           printf("Feed Hold on\n");
> >       }
> >   }
> >
> > Regards
> > TK
> >  
> >  
> >  
> >  
> >
> > From: albertplatek <albertplatek86@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Monday, November 14, 2011 7:25 AM
> > Subject: [DynoMotion] Re: Experimental Version 4.28x allows control of KMotionCNC from KFLOP
> >
> >
> >  
> > Hi Tom,
> >
> > When I want compile program with new function I get error:
> >
> > tcc: undefined symbol 'DoPC'
> >
> > #include "KMotionDef.h"
> > main()
> > {
> > DoPC(PC_COMM_HALT);
> > }
> >
> > With other functions compiler aslo say it's undefined symbol.
> >
> > Best Regards
> > Albert P³atek
> >
> > --- In DynoMotion@yahoogroups.com, "TKSOFT" <tk@> wrote:
> > >
> > >
> > >
> > >
> > > This test version allows some operations such as Halt, Execute, Zero X
> > > DRO, etc to be commanded from within a KFLOP User program. Typically
> > > this might be from an external pushbutton connected to a KFLOP input.
> > > There are some additional actions supported as well, see:
> > >
> > > Control KMotionCNC from KFLOP
> > > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > > <http://www.dynomotion.com/Help/KMotionCNC/KMotionCNCCmdsFrKFLOP.htm>
> > >
> > > Also added is a means of specifying MCode Parameters for MCodes 100-119
> > > see:
> > >
> > > MCodes with Parameters
> > > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > > <http://www.dynomotion.com/Help/KMotionCNC/MCodesWithParams.htm>
> > >
> > > This version also contains a fix for Mach3 probing in 6-axis.
> > > Unfortunately this involved shifting the Probe status variable from 56
> > > to 62 so existing probe C programs will require this modification. See
> > > the updated NotifyProbeMach3.c example where the status variable is now
> > > defined symbolically.
> > >
> > > A fix for an inappropriate Error MessageBox when KMotionCNC was halted
> > > during a dwell is included.
> > >
> > > Any feedback appreciated.
> > >
> > >
> > >
> > > http://www.dynomotion.com/Software/KMotion428x.exe
> > > <http://www.dynomotion.com/Software/KMotion428x.exe>
> > >
> > > Thanks
> > >
> > > TK
> > >
> >
>  
>